<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="sitemesh" uri="http://www.opensymphony.com/sitemesh/decorator" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>

<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta charset="utf-8"/>
    <title><sitemesh:title/></title>

    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"/>

    <link rel="stylesheet" href="${ctx}/static/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="${ctx}/static/css/font-awesome.min.css"/>

    <!-- page specific plugin styles -->

    <!-- text fonts -->
    <link rel="stylesheet" href="${ctx}/static/css/ace-fonts.min.css"/>

    <!-- ace styles -->
    <link rel="stylesheet" href="${ctx}/static/css/ace.min.css" class="ace-main-stylesheet" id="main-ace-style"/>

    <!--[if lte IE 9]>
    <link rel="stylesheet" href="${ctx}/static/css/ace-part2.min.css" class="ace-main-stylesheet"/>
    <![endif]-->

    <!--[if lte IE 9]>
    <link rel="stylesheet" href="${ctx}/static/css/ace-ie.min.css"/>
    <![endif]-->

    <!-- inline styles related to this page -->

    <link rel="stylesheet" href="${ctx}/static/css/validate.css"/>

    <!-- ace settings handler -->
    <script src="${ctx}/static/js/ace-extra.min.js"></script>

    <!-- HTML5shiv and Respond.min.js for IE8 to support HTML5 elements and media queries -->

    <!--[if lte IE 8]>
    <script src="${ctx}/static/js/html5shiv.min.js"></script>
    <script src="${ctx}/static/js/respond.min.js"></script>
    <![endif]-->


    <!-- basic scripts -->

    <!--[if !IE]> -->
    <script type="text/javascript">
        window.jQuery || document.write("<script src='${ctx}/static/js/jquery.min.js'>" + "<" + "/script>");
    </script>

    <!-- <![endif]-->

    <!--[if IE]>
    <script type="text/javascript">
        window.jQuery || document.write("<script src='${ctx}/static/js/jquery1x.min.js'>" + "<" + "/script>");
    </script>
    <![endif]-->
    <script type="text/javascript">
        if ('ontouchstart' in document.documentElement) document.write("<script src='${ctx}/static/js/jquery.mobile.custom.min.js'>" + "<" + "/script>");
    </script>
    <script src="${ctx}/static/js/bootstrap.min.js"></script>
    <script src="${ctx}/static/js/common.js"></script>

    <!-- page specific plugin scripts -->

    <!-- ace scripts -->
    <script src="${ctx}/static/js/ace-elements.min.js"></script>
    <script src="${ctx}/static/js/ace.min.js"></script>
    <%
        String wordValue = request.getParameter("word");
    %>
    <sitemesh:head/>
</head>

<body class="no-skin" onload="JavaScript:viewNavTab('<%=wordValue %>');">
<!-- #section:basics/navbar.layout -->
<div id="navbar" class="navbar navbar-default">
    <script type="text/javascript">
        try {
            ace.settings.check('navbar', 'fixed')
        } catch (e) {
        }
    </script>

    <div class="navbar-container" id="navbar-container">
        <!-- #section:basics/sidebar.mobile.toggle -->
        <button type="button" class="navbar-toggle menu-toggler pull-left" id="menu-toggler" data-target="#sidebar">
            <span class="sr-only">Toggle sidebar</span>

            <span class="icon-bar"></span>

            <span class="icon-bar"></span>

            <span class="icon-bar"></span>
        </button>

        <!-- /section:basics/sidebar.mobile.toggle -->
        <div class="navbar-header pull-left">
            <!-- #section:basics/navbar.layout.brand -->
            <a href="#" class="navbar-brand">
                <small>
                    <i class="fa fa-leaf"></i>
                    云族谱后台管理系统
                </small>
            </a>
        </div>

        <div class="navbar-buttons navbar-header pull-right" role="navigation">
            <ul class="nav ace-nav">

                <li class="light-blue">
                    <a data-toggle="dropdown" href="#" class="dropdown-toggle">
                        <img class="nav-user-photo" src="${ctx}/static/avatars/user.jpg" alt="Jason's Photo"/>
								<span class="user-info">
									<small>欢迎,</small>
									<shiro:principal/>
								</span>

                        <i class="ace-icon fa fa-caret-down"></i>
                    </a>

                    <ul class="user-menu dropdown-menu-right dropdown-menu dropdown-yellow dropdown-caret dropdown-closer">
                        <li>
                            <a href="${ctx}/profile">
                                <i class="ace-icon fa fa-cog"></i>
                                个人信息设置
                            </a>
                        </li>

                        <li>
                            <a href="${ctx}/profile/updatePassword">
                                <i class="ace-icon fa fa-cog"></i>
                                修改密码
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="${ctx}/logout">
                                <i class="ace-icon fa fa-power-off"></i>
                                退出登录
                            </a>
                        </li>
                    </ul>
                </li>
            </ul>
        </div>
    </div>
</div>

<div class="main-container" id="main-container">
    <div id="sidebar" class="sidebar responsive">
        <script type="text/javascript">
            try {
                ace.settings.check('sidebar', 'fixed')
            } catch (e) {
            }
        </script>

        <div class="sidebar-shortcuts" id="sidebar-shortcuts">
            <button class="btn disabled btn-info btn-block">菜单
                <i class="ace-icon fa fa-fire  align-top bigger-125 icon-on-right"></i>
            </button>
        </div>
        <ul class="nav nav-list">

            <!-- 用户管理 -->
            <li id="user_li" class="" onclick="viewNavTab(user)">
                <a href="${ctx}/user/list?word=user">
                    <i class="menu-icon fa fa-caret-right"></i>
                    全部用户
                </a>
                <b class="arrow"></b>
            </li>

            <!-- 人员管理 -->
            <li id="person_li" class="" onclick="viewNavTab(person)">
                <a href="#" class="dropdown-toggle">
                    <i class="menu-icon fa fa-desktop"></i>
                    <span class="menu-text"> 人员管理 </span>
                    <b class="arrow fa fa-angle-down"></b>
                </a>
                <b class="arrow"></b>
                <ul class="submenu">
                    <li class="">
                        <a href="${ctx}/person/list?word=person">
                            <i class="menu-icon fa fa-caret-right"></i>
                            人员列表
                        </a>
                        <b class="arrow"></b>
                    </li>
                    <li class="">
                        <a href="${ctx}/person/create?word=person">
                            <i class="menu-icon fa fa-caret-right"></i>
                            人员新增
                        </a>
                        <b class="arrow"></b>
                    </li>
                </ul>
            </li>

            <!-- 家族管理 -->
            <li id="family_li" class="" onclick="viewNavTab(family)">
                <a href="#" class="dropdown-toggle">
                    <i class="menu-icon fa fa-desktop"></i>
                    <span class="menu-text"> 家族管理 </span>
                    <b class="arrow fa fa-angle-down"></b>
                </a>
                <b class="arrow"></b>
                <ul class="submenu">
                    <li id="user1_li" class="">
                        <a href="${ctx}/family/list?word=family">
                            <i class="menu-icon fa fa-caret-right"></i>
                            家族列表
                        </a>
                        <b class="arrow"></b>
                    </li>

                    <li class="">
                        <a href="${ctx}/familytree/ftree?word=family">
                            <i class="menu-icon fa fa-caret-right"></i>
                            家族树
                        </a>
                        <b class="arrow"></b>
                    </li>
                    <li class="">
                        <a href="${ctx}/family/list?word=family">
                            <i class="menu-icon fa fa-caret-right"></i>
                            家族圈管理
                        </a>
                        <b class="arrow"></b>
                    </li>
                    <li class="">
                        <a href="${ctx}/feed/list?type=1&word=family">
                            <i class="menu-icon fa fa-caret-right"></i>
                            家族动态
                        </a>
                        <b class="arrow"></b>
                    </li>
                    <li class="">
                        <a href="${ctx}/feed/list?type=2&word=family">
                            <i class="menu-icon fa fa-caret-right"></i>
                            大事记
                        </a>
                        <b class="arrow"></b>
                    </li>
                    <li class="">
                        <a href="${ctx}/feed/list?type=3&word=family">
                            <i class="menu-icon fa fa-caret-right"></i>
                            分享
                        </a>
                        <b class="arrow"></b>
                    </li>
                    <li class="">
                        <a href="${ctx}/feed/list?type=4&word=family">
                            <i class="menu-icon fa fa-caret-right"></i>
                            历程
                        </a>
                        <b class="arrow"></b>
                    </li>
                    <li class="">
                        <a href="${ctx}/user/list?apply=1&word=family">
                            <i class="menu-icon fa fa-caret-right"></i>
                            申请列表
                        </a>
                        <b class="arrow"></b>
                    </li>
                </ul>
            </li>
            <!-- 统计管理 -->
            <li id="statistics_li" class="" onclick="viewNavTab(statistics)">
                <a href="#" class="dropdown-toggle">
                    <i class="menu-icon fa fa-desktop"></i>
                    <span class="menu-text"> 统计管理 </span>
                    <b class="arrow fa fa-angle-down"></b>
                </a>
                <b class="arrow"></b>
                <ul class="submenu">
                    <li class="">
                        <a href="${ctx}/statistics/list?word=statistics">
                            <i class="menu-icon fa fa-caret-right"></i>
                            全网统计
                        </a>
                        <b class="arrow"></b>
                    </li>
                </ul>
            </li>
            <li id="msg_li" class="" onclick="viewNavTab(msg)">
            <a href="${ctx}/msg/list?word=business">
                <i class="menu-icon fa fa-caret-right"></i>
                消息管理
            </a>
            <b class="arrow"></b>
        </li>
            <li id="feed_li" class="" onclick="viewNavTab(feed)">
                <a href="${ctx}/feed/list?word=business">
                    <i class="menu-icon fa fa-caret-right"></i>
                    聊天管理
                </a>
                <b class="arrow"></b>
            </li>

            <li id="feedback_li" class="" onclick="viewNavTab(feedback)">
                <a href="${ctx}/feedback/list?word=business">
                    <i class="menu-icon fa fa-caret-right"></i>
                    用户反馈
                </a>
                <b class="arrow"></b>
            </li>

            <!-- 新闻管理 -->
            <li id="news_li" class="" onclick="viewNavTab(news)">
                <a href="#" class="dropdown-toggle">
                    <i class="menu-icon fa fa-desktop"></i>
                    <span class="menu-text"> 新闻管理 </span>
                    <b class="arrow fa fa-angle-down"></b>
                </a>
                <b class="arrow"></b>
                <ul class="submenu">
                    <li class="">
                        <a href="${ctx}/news/list?word=news">
                            <i class="menu-icon fa fa-caret-right"></i>
                            新闻列表
                        </a>
                        <b class="arrow"></b>
                    </li>
                    <li class="">
                        <a href="${ctx}/news/init">
                            <i class="menu-icon fa fa-caret-right"></i>
                            发布新闻
                        </a>
                        <b class="arrow"></b>
                    </li>
                </ul>
            </li>

            <!-- 捐款管理 -->
            <li id="order_li" class="" onclick="viewNavTab(order)">
                <a href="#" class="dropdown-toggle">
                    <i class="menu-icon fa fa-desktop"></i>
                    <span class="menu-text"> 募捐管理 </span>
                    <b class="arrow fa fa-angle-down"></b>
                </a>
                <b class="arrow"></b>
                <ul class="submenu">
                    <li class="">
                        <a href="${ctx}/order/list?word=order">
                            <i class="menu-icon fa fa-caret-right"></i>
                            募捐列表
                        </a>
                        <b class="arrow"></b>
                    </li>
                    <li class="">
                        <a href="${ctx}/order/create?word=order">
                            <i class="menu-icon fa fa-caret-right"></i>
                            募捐发布
                        </a>
                        <b class="arrow"></b>
                    </li>
                </ul>
            </li>

                <!-- start 权限管理 -->
            <shiro:hasRole name="admin">
            <li id="permission_li" class="" onclick="viewNavTab(permission)">
                <a href="#" class="dropdown-toggle">
                    <i class="menu-icon fa fa-desktop"></i>
                    <span class="menu-text"> 权限管理 </span>
                    <b class="arrow fa fa-angle-down"></b>
                </a>

                <b class="arrow"></b>
                <ul class="submenu">
                    <li class="">
                        <a href="${ctx}/user/admin?word=permission">
                            <i class="menu-icon fa fa-caret-right"></i>
                            账号管理
                        </a>
                        <b class="arrow"></b>
                    </li>
                    <li class="">
                        <a href="${ctx}/permission/list?word=permission">
                            <i class="menu-icon fa fa-caret-right"></i>
                            资源管理
                        </a>

                        <b class="arrow"></b>
                    </li>
                    <li class="">
                        <a href="${ctx}/role/list?word=permission">
                            <i class="menu-icon fa fa-caret-right"></i>
                            角色管理
                        </a>

                        <b class="arrow"></b>
                    </li>
                </ul>
            </li>
            </shiro:hasRole>

        </ul><!-- /.nav-list -->

        <!-- #section:basics/sidebar.layout.minimize -->
        <div class="sidebar-toggle sidebar-collapse" id="sidebar-collapse">
            <i class="ace-icon fa fa-angle-double-left" data-icon1="ace-icon fa fa-angle-double-left"
               data-icon2="ace-icon fa fa-angle-double-right"></i>
        </div>

        <!-- /section:basics/sidebar.layout.minimize -->
        <script type="text/javascript">
            try {
                ace.settings.check('sidebar', 'collapsed')
            } catch (e) {
            }

            var lis = new Array('user_li', 'auction_li', 'person_li', 'order_li', 'statistics_li', 'msg_li', 'family_li', 'permission_li', 'business_li', 'financeorder_li', 'order_li', 'cargps_li', 'feed_li', 'feedback_li', 'host_li', 'news_li','');

            function viewNavTab(id) {
                for (var i = 0; i < lis.length; i++) {
                    var lisValue = document.getElementById(lis[i]);
                    var idValue = id + '_li';
                    if (lisValue) {
                        if (idValue == lis[i]) {
                            lisValue.className = "active";
                        } else {
                            lisValue.className = "";
                        }
                    }
                }
            }
        </script>
    </div>

    <!-- /section:basics/sidebar -->
    <div class="main-content">

        <!-- PAGE CONTENT BEGINS -->
        <sitemesh:body/>
        <!-- PAGE CONTENT ENDS -->

    </div><!-- /.main-content -->
</div><!-- /.main-container -->
</body>
</html>
